﻿<Window x:Class="Demos.MFSets.View"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MFSet" Height="400" Width="800">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition></RowDefinition>
            <RowDefinition Height="45"></RowDefinition>
        </Grid.RowDefinitions>
        
        <GroupBox Grid.Row="0" Header="Configuración" Margin="5">
            <Grid Margin="10,5,10,5">
                <Grid.RowDefinitions>
                    <RowDefinition></RowDefinition>
                    <RowDefinition></RowDefinition>
                    <RowDefinition></RowDefinition>
                    <RowDefinition></RowDefinition>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition></ColumnDefinition>
                    <ColumnDefinition></ColumnDefinition>
                    <ColumnDefinition></ColumnDefinition>
                    <ColumnDefinition></ColumnDefinition>
                </Grid.ColumnDefinitions>
                
                <Label Grid.Row="0" Grid.Column="0" Margin="0,0,0,5">Implementaciones:</Label>
                <CheckBox Grid.Row="1" Grid.Column="0"
                          IsChecked="{Binding Selecciones[0], UpdateSourceTrigger=PropertyChanged}">MFSet</CheckBox>
                <CheckBox Grid.Row="1" Grid.Column="1" 
                          IsChecked="{Binding Selecciones[1], UpdateSourceTrigger=PropertyChanged}">Naive MFSet</CheckBox>
                <CheckBox Grid.Row="1" Grid.Column="2"
                          IsChecked="{Binding Selecciones[2], UpdateSourceTrigger=PropertyChanged}">Path Compression</CheckBox>
                <CheckBox Grid.Row="1" Grid.Column="3"
                          IsChecked="{Binding Selecciones[3], UpdateSourceTrigger=PropertyChanged}">Rank Union</CheckBox>

                <Label Grid.Row="2" Grid.Column="0" Margin="0,5,0,5">Tipos:</Label>
                <CheckBox Grid.Row="3" Grid.Column="0"
                          IsChecked="{Binding Selecciones[4], UpdateSourceTrigger=PropertyChanged}">Struct (Entero)</CheckBox>
                <CheckBox Grid.Row="3" Grid.Column="1"
                          IsChecked="{Binding Selecciones[5], UpdateSourceTrigger=PropertyChanged}">Class</CheckBox>
                <CheckBox Grid.Row="3" Grid.Column="3"
                          IsChecked="{Binding Selecciones[6], UpdateSourceTrigger=PropertyChanged}"
                          Command="{Binding SeleccionarTodoCommand}">Seleccionar todo</CheckBox>
            </Grid>
        </GroupBox>

        <GroupBox Grid.Row="1" Margin="5" Header="Resultados">
            <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition></RowDefinition>
                        <RowDefinition></RowDefinition>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition></ColumnDefinition>
                        <ColumnDefinition></ColumnDefinition>
                        <ColumnDefinition></ColumnDefinition>
                        <ColumnDefinition></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    
                    <Border Grid.Column="0" Grid.Row="0" BorderBrush="Black" BorderThickness="1" >
                        <StackPanel>
                            <Label FontWeight="Bold">MFSet (Struct)</Label>
                            <Label Content="{Binding TiemposAcumulados[0], UpdateSourceTrigger=PropertyChanged}"></Label>
                            <Label Content="{Binding TiemposMedios[0], UpdateSourceTrigger=PropertyChanged}"></Label>
                        </StackPanel>
                    </Border>
                    <Border Grid.Column="1" Grid.Row="0" BorderBrush="Black" BorderThickness="1">
                        <StackPanel>
                            <Label FontWeight="Bold">Naive MFSet (Struct)</Label>
                            <Label Content="{Binding TiemposAcumulados[1], UpdateSourceTrigger=PropertyChanged}"></Label>
                            <Label Content="{Binding TiemposMedios[1], UpdateSourceTrigger=PropertyChanged}"></Label>
                        </StackPanel>
                    </Border>
                    <Border Grid.Column="2" Grid.Row="0" BorderBrush="Black" BorderThickness="1" >
                        <StackPanel>
                            <Label FontWeight="Bold">PathCompression (Struct)</Label>
                            <Label Content="{Binding TiemposAcumulados[2], UpdateSourceTrigger=PropertyChanged}"></Label>
                            <Label Content="{Binding TiemposMedios[2], UpdateSourceTrigger=PropertyChanged}"></Label>
                        </StackPanel>
                    </Border>
                    <Border Grid.Column="3" Grid.Row="0" BorderBrush="Black" BorderThickness="1" >
                        <StackPanel>
                            <Label FontWeight="Bold">RankUnion (Struct)</Label>
                            <Label Content="{Binding TiemposAcumulados[3], UpdateSourceTrigger=PropertyChanged}"></Label>
                            <Label Content="{Binding TiemposMedios[3], UpdateSourceTrigger=PropertyChanged}"></Label>
                        </StackPanel>
                    </Border>

                    <Border Grid.Column="0" Grid.Row="1" BorderBrush="Black" BorderThickness="1" >
                        <StackPanel>
                            <Label FontWeight="Bold">MFSet (Class)</Label>
                            <Label Content="{Binding TiemposAcumulados[4], UpdateSourceTrigger=PropertyChanged}"></Label>
                            <Label Content="{Binding TiemposMedios[4], UpdateSourceTrigger=PropertyChanged}"></Label>
                        </StackPanel>
                    </Border>
                    <Border Grid.Column="1" Grid.Row="1" BorderBrush="Black" BorderThickness="1">
                        <StackPanel>
                            <Label FontWeight="Bold">Naive MFSet (Class)</Label>
                            <Label Content="{Binding TiemposAcumulados[5], UpdateSourceTrigger=PropertyChanged}"></Label>
                            <Label Content="{Binding TiemposMedios[5], UpdateSourceTrigger=PropertyChanged}"></Label>
                        </StackPanel>
                    </Border>
                    <Border Grid.Column="2" Grid.Row="1" BorderBrush="Black" BorderThickness="1" >
                        <StackPanel>
                            <Label FontWeight="Bold">PathCompression (Class)</Label>
                            <Label Content="{Binding TiemposAcumulados[6], UpdateSourceTrigger=PropertyChanged}"></Label>
                            <Label Content="{Binding TiemposMedios[6], UpdateSourceTrigger=PropertyChanged}"></Label>
                        </StackPanel>
                    </Border>
                    <Border Grid.Column="3" Grid.Row="1" BorderBrush="Black" BorderThickness="1">
                        <StackPanel>
                            <Label FontWeight="Bold">RankUnion (Class)</Label>
                            <Label Content="{Binding TiemposAcumulados[7], UpdateSourceTrigger=PropertyChanged}"></Label>
                            <Label Content="{Binding TiemposMedios[7], UpdateSourceTrigger=PropertyChanged}"></Label>
                        </StackPanel>
                    </Border>
                </Grid>
            </ScrollViewer>
        </GroupBox>

        <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center" Margin="5">
            <Label Margin="5">Nº Operaciones:</Label>
            <TextBox Width="100" Height="25" Margin="0,5,5,5" TextAlignment="Right"
                     Text="{Binding NumOperaciones, UpdateSourceTrigger=PropertyChanged}"></TextBox>
            <Label Margin="5">Intervalo de mediciones:</Label>
            <TextBox Width="100" Height="25" Margin="0,5,5,5" TextAlignment="Right"
                     Text="{Binding IntervaloMediciones, UpdateSourceTrigger=PropertyChanged}"></TextBox>
            <Button Margin="5" Width="80" Command="{Binding ComenzarCommand}">Comenzar</Button>
            <Button Margin="5" Width="80" Command="{Binding BorrarCommand}">Borrar</Button>
            <Button Margin="5" Width="80" Command="{Binding VerGraficoCommand}">Ver gráfico</Button>
        </StackPanel>
    </Grid>
</Window>
